
package demo.osgi.dictquery.remote;

import demo.osgi.dictquery.QueryService;
import org.osgi.framework.*;

public class Activator
    implements BundleActivator
{

    public Activator()
    {
    }

    static BundleContext getContext()
    {
        return context;
    }

    public void start(BundleContext bundleContext)
        throws Exception
    {
        context = bundleContext;
        sr = context.registerService(QueryService.class.getName(), new RemoteDictQueryServiceImpl(), null);
    }

    public void stop(BundleContext bundleContext)
        throws Exception
    {
        sr.unregister();
        context = null;
    }

    private static BundleContext context;
    private ServiceRegistration sr;
}
